﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Xml.Serialization;

namespace WTwitter.Model.UserData {
	public class SearchTimelineSetting : TimelineSetting {
		public override string TimelineTypeName {
			get {
				return "タイムライン(Search API)";
			}
		}
		
		[XmlIgnore]
		public override TimelineSetting.Type TimelineType {
			get { return Type.Search;}
		}

		/// <summary>
		/// 取得用のURL
		/// </summary>
		public override string Url {
			get {
				string lang = IsJapaneseOnly ? "&lang=ja" : "";
				_searchUrl = "http://search.twitter.com/search.json?q=" + HttpUtility.UrlEncode(SearchText) + lang;
				return _searchUrl;
			}
			set {
				//do nothing
			}
		}
		public string SearchText { get; set; }
		public bool IsJapaneseOnly { get; set; }
		private string _searchUrl;
	}
}
